<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="animate.css">
    <style>
        .group{
            width: 500px;
        }
        .group button,.group ul{
            width: 100%;
            height: 35px;
        }
        .group ul{
            height: 60px;
            list-style: none;
            padding-left: 0px;
            margin: 0;
            background-color:#f0f0f0;
        }      
    </style>
</head>
<body>
    <div id="app">
        <group  v-for='k in group' :value='k'></group>
    </div>
    <script src='vue.js'></script>
    <script type="text/html" id="group">
        <div class="group">
            <div class='item'>
                <button @click="isshow=!isshow">{{value.title}}</button>    
                <transition 
                    enter-active-class='animated zoomIn'
                    leave-active-class='animated hinge'
                >
                    <ul v-show='isshow'>
                        <li v-for='i in value.data'>{{i}}</li>
                    </ul>
                </transition>           
            </div>
            
        </div>
    </script>
    <script>
        Vue.component('group',{
            template:'#group',
            props:['value'],
            data:function(){
                return {
                    isshow:false,
                }
            }
        })
        new Vue({
            el:'#app',
            data:{
                group:{
                        friends:{
                            title:'朋友',
                            data:['小贱','谦谦'],
                        },
                        family:{
                            title:'家人',
                            data:['美女','帅哥','小妞'],
                        },
                        classmates:{
                            title:'同学',
                            data:['刘若英','王菲','谢霆锋'],
                        }
                    }
            }
        })
    </script>
</body>
</html>